/*
 * @Author: 别拿暗恋当饭吃. 13466071+lililkli@user.noreply.gitee.com
 * @Date: 2024-07-09 09:11:06
 * @LastEditors: 别拿暗恋当饭吃. 13466071+lililkli@user.noreply.gitee.com
 * @LastEditTime: 2024-07-09 14:03:58
 * @FilePath: \新建文件夹\doctor\src\store\Consultationinformation\ListofinFormation\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

//引入createSlice  和 createAsyncThunk
import {createSlice,createAsyncThunk} from '@reduxjs/toolkit'
// 引如接口
import * as services from 'services/Consultationinformation/ListofinFormation'
import { addBuilder } from 'store/dict'


export const doListofinFormation = createAsyncThunk<any,any>(
    "ListofinFormation/doListofinFormation",async(data)=>{
        // console.log(data.recordId);
        const res = await services.ListofinFormation(data)
        return res
    }
)
const initialState = {
    ListofinFormation :{}
}
const DoctorIdlist = createSlice({
    name:'ListofinFormation',
    initialState,
    reducers:{},
    extraReducers:(builder)=>{
        addBuilder(builder,doListofinFormation,(state,action)=>{
            // console.log(action.payload);
            const {result} = action.payload
            state.ListofinFormation = result
        })
    }
})


export default DoctorIdlist.reducer

export const DoctorIdlistSlice = (state:any) =>{
    return state.ListofinFormation.ListofinFormation
}